package org.mybatis.generator;

import java.io.FileInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

import org.mybatis.generator.api.MyBatisGenerator;
import org.mybatis.generator.config.Configuration;
import org.mybatis.generator.config.xml.ConfigurationParser;
import org.mybatis.generator.internal.DefaultShellCallback;

public class MbrGenerator {
	/**系统在发布之前应删除或屏蔽测试代码。
	public static void main(String[] args) {
		Locale.setDefault(Locale.ENGLISH);
		//System.out.println(Locale.getDefault());
		if(args.length < 1)
		{
			return;
		}
		try
		{
//			args[0] ="D:\\mbr30\\mbr30-mybatis-generator.xml";
			//System.out.println(args[0]);
			InputStream is = new FileInputStream(args[0]);
//			InputStream is = MbrGenerator.class.getClassLoader().getResourceAsStream("mbr30-mybatis-generator.xml");
			
			List<String> warnings = new ArrayList<String>();
			   boolean overwrite = true;
			   ConfigurationParser cp = new ConfigurationParser(warnings);
			   Configuration config = cp.parseConfiguration(is);
			   DefaultShellCallback callback = new DefaultShellCallback(overwrite);
			   MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
			   myBatisGenerator.generate(null);
		}catch(Exception e)
		{
			e.printStackTrace();
		}

	}*/
}
